import React, { useContext } from "react";
//3. 导入 context 对象
import {context} from './A';
export default function C() {
  //4. 使用 useContext 函数获取数据
  let [count, setCount] = useContext(context);
  return (
    <div>
      <div>C</div>
      <p>{count}</p>
      <button onClick={() => {
        setCount(count + 1);
      }}>新增</button>
    </div>
  );
}
